import React, { Fragment, useState, useEffect } from 'react';
import type { FC } from 'react';
import 'braft-editor/dist/index.css';
import BraftEditor from 'braft-editor';

const RichText: FC<Record<string, any>> = () => {
  const [editorState, setEditorState] = useState(BraftEditor.createEditorState(''));

  const handleChange = (editorState: any) => {
    setEditorState(editorState);
    console.log(editorState.toHTML());
  };
  return <BraftEditor value={editorState} onChange={handleChange} />;
};

export default RichText